/*
 * Created by LiuYou on 2020/11/4.
 *
 */

#ifndef EFFECTIVECPP_ENUMERATION_HPP
#define EFFECTIVECPP_ENUMERATION_HPP


namespace ly {

    /**
     * 限定作用域的枚举类型
     */
    enum class OpenMode : int {
        input,
        output,
        append
    };

    /**
     * 不限定作用域的枚举类型
     */
    enum Color : int {
        red,
        yellow,
        green
    };

    enum {
        name = 100,
        id = 3118004946,
        group = 180807
    } student;

    /**
     * TODO questions: 是否将枚举也封装到类中？？？？
     */
    class GamePlayer {
    private:

        // 必须进行强转
        int color[static_cast<int>(OpenMode::append)];

        enum class Num : int {
            NumTurns = 5,
        };
        int scores[static_cast<int>(Num::NumTurns)];
    };

}


#endif //EFFECTIVECPP_ENUMERATION_HPP
